package com.link.base.base.accnt.service;

import com.link.base.base.accnt.dao.mybatis.mapper.AccntBrandMapper;
import com.link.base.base.accnt.model.AccntBrand;
import com.link.core.cllog.LCLogger;
import com.link.core.basic.dao.mapper.BasicMapper;
import com.link.core.basic.service.BasicServiceException;
import com.link.core.basic.service.BasicServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
/**
 * Copyright  hande Company. All Rights Reserved.
 *
 * @author  unknwon
 * @date:   2018/11/7 15:31
 * @version 1.0
 */

@Service
public class AccntBrandServiceImpl extends BasicServiceImpl<AccntBrand> implements AccntBrandService {

    @Resource
    private AccntBrandMapper accntBrandMapper;

    @Override
    public BasicMapper<AccntBrand> getBasicMapper() {
        return accntBrandMapper;
    }

    /**
     * 根据值列列表类型和独立源代码找指列表
     * @param accntBrand
     * @return
     * @throws BasicServiceException
     */
    @Override
    public AccntBrand getLovByValAndType(AccntBrand accntBrand) throws BasicServiceException {
        AccntBrand accntBrandRest = null;
        try {
            accntBrandRest = accntBrandMapper.getLovByValAndType(accntBrand);
        } catch (Exception e) {
            LCLogger.withException(e);
            throw new BasicServiceException(e.getMessage());
        }
        return accntBrandRest;
    }

}
